﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// 移除货件
    /// </summary>
    /// 

    public class FBAShipmentDTO
    {
        public string code { get; set; }
        public string message { get; set; }
        public string request_id { get; set; }
        public string response_time { get; set; }
        public int total { get; set; }
        public item data { get; set; }

    }

    public class item
    {
        public List<FBAShipment> list { get; set; }
    }

    public class FBAShipment
    {

        public string RowId { get; set; }

        public string id { get; set; }
        /// <summary>
        /// 店铺id	
        /// </summary>
        public string sid { get; set; }
        /// <summary>
        /// 店铺名称	
        /// </summary>
        public string seller { get; set; }
        /// <summary>
        /// 创建人id
        /// </summary>
        public string uid { get; set; }

        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string username { get; set; }
        /// <summary>
        /// 亚马逊货件编号
        /// </summary>
        public string shipment_id { get; set; }
        /// <summary>
        /// 货件名称
        /// </summary>
        public string shipment_name { get; set; }
        /// <summary>
        /// 是否是已完成状态：0 进行中，1 已完成
        /// </summary>
        public string _is_closed;
        public string is_closed
        {
            get { return _is_closed; }

            set
            {
                if (value == "0") _is_closed = "进行中";
                else if (value == "1") _is_closed = "已完成";
                else _is_closed = value;
            }

        }
        /// <summary>
        /// 状态
        /// </summary>
        /// 
        //        状态：
        //working：卖家已创建货件，但尚未发货
        //shipped：承运人已取件
        //In_transit：承运人已通知亚马逊配送中心，知晓货件的存在
        //delivered：承运人已将货件配送至亚马逊配送中心
        //Check_in：货件已在亚马逊配送中心的收货区域登记
        //receiving：货件已到达亚马逊配送中心，但有部分商品尚未标记为已收到
        //closed：货件已到达亚马逊配送中心，且所有商品已标记为已收到
        //cancelled：卖家在将货件发送至亚马逊配送中心后取消了货件
        //delete：卖家在将货件发送至亚马逊配送中心前取消了货件
        //error：货件出错，但其并非亚马逊处理
        public string shipment_status { get; set; }
        /// <summary>
        /// 数据更新时间
        /// </summary>
        public string gmt_modified { get; set; }
        /// <summary>
        /// 数据创建时间
        /// </summary>
        public string gmt_create { get; set; }
        /// <summary>
        /// 同步时间
        /// </summary>
        public string sync_time { get; set; }
        /// <summary>
        /// 物流中心编码
        /// </summary>
        public string destination_fulfillment_center_id { get; set; }
        /// <summary>
        /// 是否erp创建：0 erp创建，1 亚马逊后台同步
        /// </summary>
        public string is_synchronous { get; set; }
        /// <summary>
        /// 是否已上传装箱信息：0 未上传，1 已上传
        /// </summary>
        public List<item_list> item_list { get; set; }
        /// <summary>
        /// WORKING时间
        /// </summary>
        public string working_time { get; set; }
        /// <summary>
        /// SHIPPED时间
        /// </summary>
        public string shipped_time { get; set; }
        /// <summary>
        /// RECEIVING时间
        /// </summary>
        public string receiving_time { get; set; }
        /// <summary>
        /// CLOSED时间
        /// </summary>
        public string closed_time { get; set; }
        /// <summary>
        /// Reference ID
        /// </summary>
        public string reference_id { get; set; }
        /// <summary>
        /// 发货地址
        /// </summary>
        public ship_from_address ship_from_address { get; set; }
        /// <summary>
        /// 发货名称
        /// </summary>
        public string from_name { get; set; }
        /// <summary>
        /// 发货国家编码
        /// </summary>
        public string from_country_code { get; set; }
        /// <summary>
        /// 发货省(州)
        /// </summary>
        public string from_state_or_province_code { get; set; }
        /// <summary>
        /// 发货城市
        /// </summary>
        public string from_city { get; set; }
        /// <summary>
        /// 发货区
        /// </summary>
        public string from_region { get; set; }
        /// <summary>
        /// 发货街道地址1
        /// </summary>
        public string from_address_line1 { get; set; }
        /// <summary>
        /// 发货街道地址2
        /// </summary>
        public string from_address_line2 { get; set; }
        /// <summary>
        /// 发货邮编
        /// </summary>
        public string from_postal_code { get; set; }
        /// <summary>
        /// 发货联系电话
        /// </summary>
        public string from_phone { get; set; }

        /// <summary>
        /// 配送地址
        /// </summary>
        public ship_to_address ship_to_address { get; set; }
        /// <summary>
        /// 配送名称
        /// </summary>
        public string to_name { get; set; }
        /// <summary>
        /// 配送国家编码
        /// </summary>
        public string to_country_code { get; set; }
        /// <summary>
        /// 配送省(州)
        /// </summary>
        public string to_state_or_province_code { get; set; }
        /// <summary>
        /// 配送城市
        /// </summary>
        public string to_city { get; set; }
        /// <summary>
        /// 配送区
        /// </summary>
        public string to_region { get; set; }
        /// <summary>
        /// 配送街道地址1
        /// </summary>
        public string to_address_line1 { get; set; }
        /// <summary>
        /// 配送街道地址2
        /// </summary>
        public string to_address_line2 { get; set; }
        /// <summary>
        /// 配送邮编
        /// </summary>
        public string to_postal_code { get; set; }
        /// <summary>
        /// 配送门牌号
        /// </summary>
        public string to_doorplate { get; set; }


    }

    /// <summary>
    /// FBA>>子项数据
    /// </summary>
    public class item_list
    {
        public string RowId { get; set; }

        /// <summary>
        /// FID
        /// </summary>
        public string ID { get; set; }
        /// <summary>
        /// FID
        /// </summary>
        public string FID { get; set; }
        /// <summary>
        /// 数据创建时间
        /// </summary>
        public string gmt_create { get; set; }

        /// <summary>
        /// MSKU	
        /// </summary>
        public string msku { get; set; }
        /// <summary>
        /// FNSKU	
        /// </summary>
        public string fnsku { get; set; }
        /// <summary>
        /// SKU	
        /// </summary>
        public string sku { get; set; }
        /// <summary>
        /// 当前申报量	
        /// </summary>
        public string quantity_shipped { get; set; }
        /// <summary>
        /// 货件初始申报量	
        /// </summary>
        public string init_quantity_shipped { get; set; }
        /// <summary>
        /// 签收数量：亚马逊配送中心已接收的商品数量	
        /// </summary>
        public string quantity_received { get; set; }

        /// <summary>
        /// 已发货数量（本地数据）
        /// </summary>
        public string quantity_shipped_local { get; set; }
        /// <summary>
        /// 每个包装箱中的商品数量	
        /// </summary>
        public string quantity_in_case { get; set; }
        /// <summary>
        /// 预处理明细	
        /// </summary>
        public string prep_details { get; set; }
        /// <summary>
        /// 预处理操作：大多数为Labeling
        /// </summary>
        public string prep_instruction { get; set; }
        /// <summary>
        /// 预处理拥有者：大多数为SELLER	
        /// </summary>
        public string prep_owner { get; set; }
        /// <summary>
        /// 生产日期	
        /// </summary>
        public string release_date { get; set; }
        /// <summary>
        /// 库存明细id	
        /// </summary>
        public string ware_house_storage_id { get; set; }
        /// <summary>
        /// 关联的发货计划单号	
        /// </summary>
        public List<shipment_plan_list> shipment_plan_list { get; set; }

        /// <summary>
        /// 关联的发货计划单号	
        /// </summary>
        public string shipment_plan_list_s { get; set; }
    }

    /// <summary>
    /// FBA>>子项数据>>关联的发货计划单号
    /// </summary>
    public class shipment_plan_list
    {

        /// <summary>
        /// 发货计划单号	
        /// </summary>
        public string shipment_plan_sn { get; set; }
    }

    /// <summary>
    /// FBA>>发货地址
    /// </summary>
    public class ship_from_address
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 国家编码
        /// </summary>
        public string country_code { get; set; }
        /// <summary>
        /// 省(州)
        /// </summary>
        public string state_or_province_code { get; set; }
        /// <summary>
        /// 城市
        /// </summary>
        public string city { get; set; }
        /// <summary>
        /// 区
        /// </summary>
        public string region { get; set; }
        /// <summary>
        /// 街道地址1
        /// </summary>
        public string address_line1 { get; set; }
        /// <summary>
        /// 街道地址2
        /// </summary>
        public string address_line2 { get; set; }
        /// <summary>
        /// 邮编
        /// </summary>
        public string postal_code { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string phone { get; set; }
    }

    /// <summary>
    /// FBA>>发货地址
    /// </summary>
    public class ship_to_address
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 国家编码
        /// </summary>
        public string country_code { get; set; }
        /// <summary>
        /// 省(州)
        /// </summary>
        public string state_or_province_code { get; set; }
        /// <summary>
        /// 城市
        /// </summary>
        public string city { get; set; }
        /// <summary>
        /// 区
        /// </summary>
        public string region { get; set; }
        /// <summary>
        /// 街道地址1
        /// </summary>
        public string address_line1 { get; set; }
        /// <summary>
        /// 街道地址2
        /// </summary>
        public string address_line2 { get; set; }
        /// <summary>
        /// 邮编
        /// </summary>
        public string postal_code { get; set; }
        /// <summary>
        /// 门牌号
        /// </summary>
        public string doorplate { get; set; }
    }
}
